#include "GameOverMenu.h"
#include "StringUtilities.h"
#include "PrintUtilities.h"
#include "MenuManager.h"
#include "UserManager.h"
#include "ServiceProvider.h"

GameOverMenu::GameOverMenu(MenuManager* const i_menuManager)
	: Menu(i_menuManager)
{
}

void GameOverMenu::Draw() const
{
	STD::cout << Print::Title(" GAME OVER ") << STD::endl << STD::endl;
	
	for (size_t i=0; i<GetSP()->GetUserMgr().m_gameoverNames.size();++i)
		STD::cout << GetSP()->GetUserMgr().m_gameoverNames.at(i) << STD::endl;

	STD::cout << Print::Options(" 0) Return to Main Menu.") << " Selection: ";
}


bool GameOverMenu::Input(const STL::string& i_input)
{
	bool goodInput = true;

	int res = Utilities::StringToInt(i_input);

	if (res == 0) 
		GetMM()->PopMenu();
	else
		goodInput=false;

	return goodInput;
}